<div class="footer tc f12 hidden" ms-controller="nav">
    <div class="w20 fl" ms-repeat-item="navs" ms-click="switchTab($index,event)">
        <div class="navs" ms-visible="currentNav!=$index" ms-css-background-image="url({{item.uncheckpic}})"></div>
        <div class="navs" ms-visible="currentNav==$index" ms-class-columnchecked="currentNav!=$index" ms-css-background-image="url({{item.checkpic}})"></div>
        <div style="padding-bottom: 5px;" ms-class-columnchecked="currentNav==item.id">{{item.column}}</div>
    </div>
</div>
<script type="text/javascript">
    (function(){
        var navVM;
        avalon.ready(function(){
            navVM = avalon.define({
                $id:"nav",
                currentNav:-1,
                navs:[
                    {
                        id:0,
                        uncheckpic:"../img/5_default.png",
                        checkpic:"../img/5_focus.png",
                        column:"行情",
                        url:"trade/index"
                    },{
                        id:1,
                        uncheckpic:"../img/2_default.png",
                        checkpic:"../img/2_focus.png",
                        column:"交易",
                        url:"trade/order_list"
                    },{
                        id:2,
                        uncheckpic:"../img/3_default.png",
                        checkpic:"../img/3_focus.png",
                        column:"服务",
                        url:"#"
                    },{
                        id:3,
                        uncheckpic:"../img/4_default.png",
                        checkpic:"../img/4_focus.png",
                        column:"发现",
                        url:"news/index"
                    },{
                        id:4,
                        uncheckpic:"../img/1_default.png",
                        checkpic:"../img/1_focus.png",
                        column:"我的",
                        url:"user/index"
                    }
                ],
                switchTab:function(idx,e){
                    e.stopPropagation();
                    navVM.currentNav = idx;
                    var u = navVM.navs[navVM.currentNav].url;
                    if(navVM.currentNav==2){
                        location.href="#";  //跳转至指定的页面
                    } else{
                        location.href="../"+u;  //跳转至指定的页面
                    }
                },
            });
        });
        Menu.current = function(shownum){
            navVM.currentNav=shownum;
        }
        Menu.exec();
    })()
</script>
